package com.ap.core.domain;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.joda.time.LocalDate;
import org.joda.time.LocalDateTime;



/**
 * User: Rohit.Dixit
 */
@Entity
@Table(name = "T_ORDER_PAYMENT_REFUND")
@AttributeOverride(name = "id",column = @Column(name = "ap_txn_id"))
@TypeDef(name = "id", typeClass = String.class)

public class OrderPaymentRefund extends Identifiable<String> {

    private static final long serialVersionUID = -747892374897239847L;
    
    @Column(name = "ap_txn_retrieval_id")
    private Long apTransactionRetrievalId;
    
    @Column(name = "ORDER_TXN_ID")
    private String orderTransactionId;
    
    @Column(name = "ORDER_RETRIEVAL_ID")
    private Long orderTransactionRetrievalId;
    

    @Column(name = "msg_id")
    private Long apMessageId;
    
    @Embedded
    @AttributeOverride(name = "value", column = @Column(name = "REFUND_AMOUNT"))
    private Amount refundAmount;

    @Column(name = "RECONCILIATION_CYCLE_ID")
    private String reconciliationCycleId;
    
    @Column(name = "reconciliation_date")
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDate")
    private LocalDate reconciliationDate;

    @Column(name = "REFUND_CURRENCY_CODE")
    private String refundCurrencyCode;

    @Column(name = "FI_ID")
    private Long fiId;
    
    @Column(name = "ZAPP_CONSUMER_ID")
    private Long zappConsumerId;
    
    @Column(name = "FI_CUSTOMER_ID")
    private String fiCustomerId;
    
    
    @Embedded
    @AttributeOverride(name = "accountNumber", column = @Column(name = "ACCOUNT_NUMBER"))
    private AccountNumber accountNumber;

    @Embedded
    @AttributeOverride(name = "sortCode", column = @Column(name = "SORT_CODE"))
    private SortCode sortCode;

    @Embedded
    @AttributeOverride(name = "rollNumber", column = @Column(name = "ROLL_NUMBER"))
    private RollNumber rollNumber;
    
    
    @Column(name = "DISTRIBUTOR_ID")
    private Long distributorId;

    @Column(name = "MERCHANT_ID")
    private Long merchantId;
    
    @Column(name = "MERCHANT_REFUND_REFERENCE")
    private String merchantRefundRef;


    @Column(name = "REFUND_REASON_TYPE")
   private String refundReasonType;

    @Column(name = "REFUND_METHOD")
    private String refundMethodType;
    
    @Column(name = "last_update_tmstmp")
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")
    private LocalDateTime lastUpdateTimestmp;

    @Column(name = "REFUND_TMSTMP")
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")
    private LocalDateTime refundTimeStmp;


    
 



    

    private  OrderPaymentRefund(){

    }

    public OrderPaymentRefund(Long apMessageId, String apTransactionId, Long apTransactionRetrievalId,  String orderTransactionId, Long orderTransactionRetrievalId, String refundCurrencyCode,
                         String reconciliationCycleId, LocalDate reconciliationDate ,  Long distributorId, Long merchantId, Amount refundAmount,String refundMethodType,
                        String refundReasonType, LocalDateTime lastUpdateTimestmp, LocalDateTime refundTimeStmp) {
        this.id = apTransactionId;
        this.apTransactionRetrievalId = apTransactionRetrievalId;
        this.orderTransactionId = orderTransactionId;
        this.orderTransactionRetrievalId = orderTransactionRetrievalId;
        this.apMessageId = apMessageId;
        this.refundCurrencyCode = refundCurrencyCode;
        this.reconciliationCycleId = reconciliationCycleId;
        this.reconciliationDate = reconciliationDate;
        /*this.fiId = fiId;
        this.zappConsumerId=zappConsumerId;
        this.fiConsumerId=fiConsumerId;
        this.accountNumber=accountNumber;
        this.sortCode=sortCode;
        this.rollNumber=rollNumber;*/
        this.distributorId = distributorId;
        this.merchantId = merchantId;
        this.refundAmount = refundAmount;
        this.refundMethodType = refundMethodType;
        this.refundReasonType = refundReasonType;
        this.lastUpdateTimestmp = lastUpdateTimestmp;
        this.refundTimeStmp = refundTimeStmp;
    }



    public void setApTransactionRetrievalId(Long apTransactionRetrievalId) {
		this.apTransactionRetrievalId = apTransactionRetrievalId;
	}

	public void setOrderTransactionId(String orderTransactionId) {
		this.orderTransactionId = orderTransactionId;
	}

	public void setOrderTransactionRetrievalId(Long orderTransactionRetrievalId) {
		this.orderTransactionRetrievalId = orderTransactionRetrievalId;
	}

	public void setApMessageId(Long apMessageId) {
		this.apMessageId = apMessageId;
	}

	public void setRefundAmount(Amount refundAmount) {
		this.refundAmount = refundAmount;
	}

	public void setReconciliationCycleId(String reconciliationCycleId) {
		this.reconciliationCycleId = reconciliationCycleId;
	}

	public void setReconciliationDate(LocalDate reconciliationDate) {
		this.reconciliationDate = reconciliationDate;
	}

	public void setRefundCurrencyCode(String refundCurrencyCode) {
		this.refundCurrencyCode = refundCurrencyCode;
	}

	public void setFiId(Long fiId) {
		this.fiId = fiId;
	}

	public void setZappConsumerId(Long zappConsumerId) {
		this.zappConsumerId = zappConsumerId;
	}

	public void setFiCustomerId(String fiCustomerId) {
		this.fiCustomerId = fiCustomerId;
	}

	public void setAccountNumber(AccountNumber accountNumber) {
		this.accountNumber = accountNumber;
	}

	public void setSortCode(SortCode sortCode) {
		this.sortCode = sortCode;
	}

	public void setRollNumber(RollNumber rollNumber) {
		this.rollNumber = rollNumber;
	}

	public void setDistributorId(Long distributorId) {
		this.distributorId = distributorId;
	}

	public void setMerchantId(Long merchantId) {
		this.merchantId = merchantId;
	}

	public void setMerchantRefundRef(String merchantRefundRef) {
		this.merchantRefundRef = merchantRefundRef;
	}

	
	public void setRefundReasonType(String refundReasonType) {
		this.refundReasonType = refundReasonType;
	}

	public void setRefundMethodType(String refundMethodType) {
		this.refundMethodType = refundMethodType;
	}

	public void setLastUpdateTimestmp(LocalDateTime lastUpdateTimestmp) {
		this.lastUpdateTimestmp = lastUpdateTimestmp;
	}

	public void setRefundTimeStmp(LocalDateTime refundTimeStmp) {
		this.refundTimeStmp = refundTimeStmp;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Long getApTransactionRetrievalId() {
		return apTransactionRetrievalId;
	}

	public String getOrderTransactionId() {
		return orderTransactionId;
	}

	public Long getOrderTransactionRetrievalId() {
		return orderTransactionRetrievalId;
	}

	public Long getApMessageId() {
		return apMessageId;
	}

	public Amount getRefundAmount() {
		return refundAmount;
	}

	public String getReconciliationCycleId() {
		return reconciliationCycleId;
	}

	public LocalDate getReconciliationDate() {
		return reconciliationDate;
	}

	public String getRefundCurrencyCode() {
		return refundCurrencyCode;
	}

	public Long getFiId() {
		return fiId;
	}

	public Long getZappConsumerId() {
		return zappConsumerId;
	}

	public String getFiCustomerId() {
		return fiCustomerId;
	}

	public AccountNumber getAccountNumber() {
		return accountNumber;
	}

	public SortCode getSortCode() {
		return sortCode;
	}

	public RollNumber getRollNumber() {
		return rollNumber;
	}

	public Long getDistributorId() {
		return distributorId;
	}

	public Long getMerchantId() {
		return merchantId;
	}

	public String getMerchantRefundRef() {
		return merchantRefundRef;
	}

	

	public String getRefundReasonType() {
		return refundReasonType;
	}

	public String getRefundMethodType() {
		return refundMethodType;
	}

	public LocalDateTime getLastUpdateTimestmp() {
		return lastUpdateTimestmp;
	}

	public LocalDateTime getRefundTimeStmp() {
		return refundTimeStmp;
	}

	/* (non-Javadoc)
         * @see java.lang.Object#toString()
         */
	@Override
	public String toString() {
		return "OrderPaymentRefund [id=" + id
				+ ", apTransactionRetrievalId="
				+ apTransactionRetrievalId + ",orderTransactionId=" + orderTransactionId
				+ ", orderTransactionRetrievalId="
				+ orderTransactionRetrievalId 
				+ ", apMessageId=" + apMessageId + ", reconciliationCycleId="
				+ reconciliationCycleId + ", refundReasonType="
				+ refundReasonType + ", distributorId=" + distributorId
				+ ", merchantId=" + merchantId + ", refundMethodType=" + refundMethodType + ",refundTimeStmp"
				+ refundTimeStmp + ", refundAmount="
				+ refundAmount + ", refundCurrencyCode=" + refundCurrencyCode
				+ ", accountNumber=" + accountNumber
				+ ", sortCode=" + sortCode
				+ ", lastUpdateTimestmp=" + lastUpdateTimestmp + ", fiCustomerId=" + fiCustomerId
				+ ", zappConsumerId=" + zappConsumerId + ", fiId=" + fiId
				+ ", rollNumber=" + rollNumber 
				+ ", reconciliationDate=" + reconciliationDate
				+ "]";
	}
    
    
}
